<?php

/*
 * This file is part of PHP CS Fixer.
 * (c) Fabien Potencier <fabien@symfony.com>
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

$a = 1;
$b = 2;
function Sum($a, &$b)
{
    $b = 5;
    $b = $a + $b;
}
Sum($a, $b);
echo $b;
echo '<br>';
$str = 'a脚本之家：http://www.jb51.net';
echo mb_substr($str, 0, 4, 'utf-8'); //截取头5个字，假定此代码所在php文件的编码为utf-8
$number = '.5';
$number = preg_replace('/^(\.\d+)/', '0$1', $number);
echo $number;
echo '<bR>';
echo sprintf('%.4f', $number);
$a = 891;
echo '<br>';
$b = sprintf('%.4f', $a);
echo 'b='.$b."<br>";
echo substr('ABCDE1234567', 0, pow(2, 3));

echo "<br>";
if(is_numeric('123456a'))
	echo '是数字';
else
	echo '非数字';


$arr = array('c'=>12,'p'=>1233,'a'=>233455);
$keys = array_keys($arr);
$key = isset($keys[array_search('c', $keys) + 1])?$keys[array_search('c', $keys) + 1]:'';
echo "next_key=".$key;

$key = '';
$arr_key2 = explode('_',$key);
var_dump($arr_key2);

 
   $a = array(array('a'=>"1",'b'=>"2"),array('a'=>"3",'b'=>"4"));
$b = array(array('a'=>"a",'b'=>"b"),array('a1'=>"c",'b'=>"d"),array('a'=>'123'));          
$c = array_merge($a,$b);
print_r($c);
?>
